﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
    public class JsonConvert
    {
        public static T GetObject<T>(string url)
        {
            Client client = new Client();
            return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(client.GetClientBySocket(url));
        }

        public static string GetObject(string url)
        {
            Client client = new Client();
            return client.GetClientBySocket(url);
        }

        public static T DeserializeObject<T>(string vale)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(vale);
        }

        public static string SerializeObject(object value)
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(value);
        }
    }
}
